package ltd.newbee.mall.config;

import io.swagger.v3.oas.models.ExternalDocumentation;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Info;
import org.springdoc.core.GroupedOpenApi;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class SwaggerOpenApiConfig {
//    @Bean
//    public GroupedOpenApi PayApi()
//    {
//        return GroupedOpenApi.builder().group("支付微服务模块").pathsToMatch("/pay/**").build();
//    }
    @Bean
    public GroupedOpenApi OtherApi()
    {
        return GroupedOpenApi.builder().group("其它微服务模块").pathsToMatch("/other/**", "/others").build();
    }

    @Bean
    public GroupedOpenApi All_newbee_mall_Api()
    {
        return GroupedOpenApi.builder().group("All_newbee_mall").pathsToMatch("/admin/**").build();
    }

    @Bean
    public OpenAPI docsOpenApi()
    {
        return new OpenAPI()
                .info(new Info().title("企业级校园商城项目")
                        .description("通用设计rest")
                        .version("v1.0"))
                .externalDocs(new ExternalDocumentation()
                        .description("www.baidu.com")
                        .url("https://yiyan.baidu.com/"));
    }
}
